package com.cloud.logger.zchain.zchainserver.controller;

import com.cloud.logger.zchain.zchainserver.entity.ZchainUser;
import com.cloud.logger.zchain.zchainserver.mongo.MongoUserRepository;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * User: wcy
 * Date: 2017/11/2
 * Time: 10:57
 */
@RestController
@RequestMapping("mongo")
public class MongoCtl {

    @Autowired
    private MongoUserRepository mongoUserRepository;

    @PostMapping("save")
    @ApiOperation(value = "保存")
    public void findByCode(@RequestBody ZchainUser message){
        mongoUserRepository.save(message);
    }

}
